package com.fatsatsuma.spreadsheets;

import junit.framework.TestCase;

/**
 * @author $Id: ImportModelTestCase.java,v 1.1 2007/06/07 17:58:02 gevans Exp $
 */
public class ImportModelTestCase extends TestCase {

	public void testImportModel() {
		ImportModel model = getModel();
		assertNotNull(model);
		assertNotNull(model.getErrorMessages());
		assertNotNull(model.getInformationMessages());
		assertNotNull(model.getWarningMessages());

		assertEquals(1, model.getErrorMessages().size());
		assertEquals(2, model.getInformationMessages().size());
		assertEquals(3, model.getWarningMessages().size());
	}

	/**
	 * @return
	 */
	private ImportModel getModel() {
		DefaultImportModel model = new DefaultImportModel();
		model.addErrorMessage(new DefaultImportMessage("An error message"));
		model.addInformationMessage(new DefaultImportMessage(
				"An info message 1"));
		model.addInformationMessage(new DefaultImportMessage(
				"An info message 2"));
		model
				.addWarningMessage(new DefaultImportMessage(
						"An warning message 1"));
		model
				.addWarningMessage(new DefaultImportMessage(
						"An warning message 2"));
		model
				.addWarningMessage(new DefaultImportMessage(
						"An warning message 3"));
		return model;
	}
}
